package com.itlong.cloud.equip.sdk;

import com.itlong.cloud.POJO.DTO.sdk.*;
import com.itlong.cloud.POJO.DTO.sdk.jd.JDPassRecordDTO;
import com.itlong.cloud.POJO.PO.DeviceElevatorFloorConfigPO;
import com.itlong.cloud.POJO.PO.DeviceElevatorInfoPO;
import com.itlong.cloud.POJO.VO.jd.JDResultVO;
import com.itlong.cloud.POJO.VO.sdk.CloudElevatorSDKGetByDeviceUniqueVO;
import com.itlong.cloud.POJO.VO.sdk.RobotNoninductiveDeviceUniqueVO;
import com.itlong.cloud.POJO.VO.sdk.RobotNoninductiveHistoryRecordVO;
import com.itlong.cloud.POJO.VO.sdk.SDKDeviceCloudControllerInfoVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      云电梯SDK设备服务暴露接口
 * <desc/>
 *
 * @createDate 2018/12/27
 */
@FeignClient(name = "equip-service")
public interface ICloudElevatorSDKServerCloudServiceClient {

    /**
     * <desc>
     *      查询项目下电梯设备唯一码列表
     * </desc>
     *
     * @return 云电梯SDK查询项目下电梯设备唯一码列表VO
     * @author wangzhi
     * @createDate 2018/12/27
     */
    @PostMapping(path = "/cloudElevatorSDK/server/getElevatorPage")
    List<String> getElevatorPage(@RequestBody CloudElevatorSDKServerGetElevatorPageDTO cloudElevatorSDKServerGetElevatorPageDTO) throws Exception;

    /**
     * <desc>
     *      根据设备唯一码查询电梯信息
     * </desc>
     *
     * @return 根据设备唯一码查询电梯信息VO
     * @author wangzhi
     * @createDate 2018/12/28
     */
    @PostMapping(path = "/cloudElevatorSDK/server/getElevatorInfo")
    List<CloudElevatorSDKGetByDeviceUniqueVO> getElevatorInfo(@RequestBody CloudElevatorSDKGetByDeviceUniqueDTO cloudElevatorSDKGetByDeviceUniqueDTO) throws Exception;

    /**
     * <desc>
     *      根据设备唯一码查询电梯信息
     * </desc>
     *
     * @param cloudElevatorSDKGetByDeviceUniqueDTO
     * @return 根据设备唯一码查询电梯信息VO
     * @author wangzhi
     * @createDate 2018/12/28
     */
    @PostMapping(path = "/cloudElevatorSDK/server/getElevatorInfoForRobot")
    List<RobotNoninductiveDeviceUniqueVO> getElevatorInfoForRobot(@RequestBody CloudElevatorSDKGetByDeviceUniqueDTO cloudElevatorSDKGetByDeviceUniqueDTO) throws Exception;

    /**
     * <desc>
     *      发送开门关门指令
     * </desc>
     *
     * @return 标准格式化响应结果
     * @author Juguang.S
     * @createDate 2018/12/28
     */
    @PostMapping(path = "/cloudElevatorSDK/server/sendOpenAndCloseDoor")
    void sendOpenAndCloseDoor(@RequestBody CloudElevatorSDKServerSendCommandDTO cloudElevatorSDKServerSendCommandDTO) throws Exception;

    /**
     * <desc>
     *      根据楼层名称获取真实楼层
     * </desc>
     *
     * @param goFloor
     * @param fromFloor
     * @return
     * @author Jiaqi.X
     * @createDate 2018/01/03
     */
    @RequestMapping(path = "smartCommunity/interface/elevator/getFloorNumByLogicFloor")
    Map<String,Object> getFloorNumByLogicFloor(@RequestParam("goFloor") String goFloor,
                                               @RequestParam("fromFloor") String fromFloor,
                                               @RequestParam("deviceUnique") String deviceUnique);

    /**
     * <desc>
     *      获取上报的信息
     * </desc>
     *
     * @param appId
     * @param appSecret
     * @param projectId
     * @return
     * @author Jiaqi.X
     * @createDate 2019/01/22
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/getReportInfo")
    Map<String,Object> getReportInfo(@RequestParam("appId") String appId,@RequestParam("appSecret")  String appSecret,@RequestParam("projectId") String projectId);

    /**
     * <desc>
     *      打开关闭上报状态
     * </desc>
     *
     * @param cloudElevatorSDKStateReportDTO
     * @author jiaqi.X
     * @createDate 2019/01/03
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/setOpenOrCloseStateReport")
    void setOpenOrCloseStateReport(@RequestBody CloudElevatorSDKStateReportDTO cloudElevatorSDKStateReportDTO) throws IOException;

    /**
     * <desc>
     *      根据楼层名称获取实际楼层和权限标识
     * </desc>
     *
     * @param floors
     * @param deviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/08/15
     */
    @RequestMapping(path = "smartCommunity/interface/elevator/getFloorNumAndNaturalFloorByLogicFloor")
    Map<String,Object> getFloorNumAndNaturalFloorByLogicFloor(@RequestParam("floors") String floors,@RequestParam("deviceUnique") String deviceUnique);

    /**
     * <desc>
     *      查询群控器的呼梯结果
     * </desc>
     *
     * @param robotId
     * @param deviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/07/17
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/getCallInfo")
    String getCallInfo(@RequestParam("robotId") String robotId,@RequestParam("deviceUnique") String deviceUnique) throws IOException;

    /**
     * <desc>
     *      查询群控器所绑定的设备
     * </desc>
     *
     * @param controllerDeviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/07/24
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/getDeviceUniqueByControllerDeviceUnique")
    String getDeviceUniqueByControllerDeviceUnique(@RequestParam("controllerDeviceUnique") String controllerDeviceUnique);

    /**
     * <desc>
     *      获取项目下机器人的呼梯记录
     * </desc>
     *
     * @param dto
     * @return
     * @author Jiaqi.X
     * @createDate 2019/07/24
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/getHistoryRecords")
    Page<RobotNoninductiveHistoryRecordVO> getHistoryRecords(@RequestBody RobotNoninductiveHistoryRecordDTO dto) throws Exception;

    /**
     * <desc>
     *      获取云电梯信息
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author Qiang.S
     * @createDate 2020/04/08
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/getElevatorByDeviceUnique")
    DeviceElevatorInfoPO getElevatorByDeviceUnique(@RequestParam("deviceUnique") String deviceUnique) throws Exception;

    /**
     * <desc>
     *      根据jd设备号获取云电梯信息
     * </desc>
     *
     * @param deviceId
     * @return
     * @author caoshuai
     * @createDate 2020/08/03
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/getElevatorByJDDeviceUnique")
    DeviceElevatorInfoPO getElevatorByJDDeviceUnique(@RequestParam("deviceId") String deviceId);

    /**
     * <desc>
     *      获取楼层信息
     * </desc>
     *
     * @param params
     * @return
     * @author caoshuai
     * @createDate 2020/08/05
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/getFloorInfoByMap")
    List<DeviceElevatorFloorConfigPO> getFloorInfoByMap(@RequestBody Map<String, Object> params);


    /**
     * <desc>
     *      获取云控制器信息
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/08/10
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/jdOpenOrCloseStateReport")
    JDResultVO jdOpenOrCloseStateReport(@RequestParam("deviceUnique") String deviceUnique,
                                        @RequestParam ("openOrClose") String openOrClose,
                                        @RequestParam ("deviceId") String deviceId,
                                        @RequestParam ("appid") String appid,
                                        @RequestParam ("secret") String secret);
    /**
     * <desc>
     *      获取云控制器信息
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/08/05
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/getDeviceCloudControllerInfo")
    SDKDeviceCloudControllerInfoVO getDeviceCloudControllerInfo(@RequestParam("deviceUnique") String deviceUnique);

    /**
     * <desc>
     *     查询华为云下群控器所绑定的设备
     * </desc>
     *
     * @param controllerDeviceUnique
     * @return
     * @author caoshuai
     * @createDate 2020/08/10
     */
    @RequestMapping(path = "cloudElevatorSDK/interface/elevator/getDeviceUniqueBy")
    String getDeviceUniqueBy(@RequestParam("controllerDeviceUnique") String controllerDeviceUnique);


    /**
     * <desc>
     *      京东上报通行记录
     * </desc>
     *
     * @param jdPassRecordDTO 京东通行记录VO
     * @return
     * @Author Zhu.yj
     * @createDate  2021/1/11
     */
    @PostMapping("/jd/eventReport/reportPassRecord")
    void reportPassRecord(@RequestBody JDPassRecordDTO jdPassRecordDTO) throws Exception;
}
